<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>答辩演示顺序</title>
</head>
<body>
<button onclick="choseStu()">选择</button>
<div id="before_queue">

</div>
<div id="res">

</div>
<div id="after_queue">

</div>
<script>
    var ary = ['老东','展兄','徐徐','龚','老杨','何老板','周平'];
    var after_ary = [];
    document.getElementById("before_queue").innerHTML="待演示："+ary;
  function choseStu(){
      document.getElementById("before_queue").innerHTML="待演示："+ary;
      var ran = Math.floor(Math.random()*ary.length);
      console.log(ary[ran])
      document.getElementById("res").innerHTML="倒垃圾："+ary[ran];
      var x = ary.splice(ran,1);
      if(x){
          after_ary.push(x);
          console.log(ary)
      }
      document.getElementById("after_queue").innerHTML="演示完毕："+after_ary;
  }


</script>
</body>
</html>